<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<div class="row">
	<div class="row" style="text-align: center;padding-top: 1px;min-height: 56px">
		<div class="col-xs-6 col-xs-offset-3">
			<div class="col-xs-6 nopadding">
				<button type="btn" class="btn col-xs-12 parentChildBtn" style="border-color: #5db2ff!important;background-color: #5db2ff">亲子课时包</button>
			</div>
			<div class="col-xs-6 nopadding">
				<button type="btn" class="btn col-xs-12 interimBtn" style="border-color: #5db2ff!important;">过渡课时包</button>
			</div>
		</div>
	</div>
	<form class="editForm" style="margin-top: 15px" action="${saveUrl}" method="post" responseType="JSON" role="form"
		  id="editForm_${serializeNum}"
		  data-bv-submitButtons="#editFormSubmitBtn_${serializeNum}"
		  data-bv-message="This value is not valid"
		  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
		  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
		  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
		<input type="hidden" name="id" value="${editEntity.id}">
		<input type="hidden" name="targetDataId" value="${memberId}">
		<input type="hidden" name="memberType" value="${memberType}">
		<input type="hidden" class="packageType" name="packageType" value="1"/>

		<div class="parentChild show">
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20 ">
					<div class="form-group">
						<label for="number" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">合同编号：</label>
						<div class="col-sm-6">
							<input data-bv-message="The field is not valid" size="50" name="dearSonContractNumber" alt="合同编号"
								   placeholder="HT10001010" type="text" title="合同编号" class="form-control"
								   value="${editEntity.number}"/>
							<span class="text"></span>
						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="packageId" class="col-sm-3 col-sm-offset-1  control-label no-padding-right">课时包名称：</label>
						<div class="col-sm-6">
							<!--<select name="packageId" id="packageId" class="col-sm-12">
                                <option value="">2017亲子96课时</option>
                            </select>-->
							<select name="dearSonPackageId" id="dearSonPackageId" class="col-sm-12 addressProvince" onchange="packageCheck(this)">
								<!--<option id="selectPackageDearSon" value="">请选择</option>
                                <#list dearSonPackageList as data>
                                    <option  value="${data.id}" packageId=${data.id} packageOriginalUnitPrice=${data.originalUnitPrice}
                                             packageValidDate=${data.validDate} packageTotalClassHour=${data.totalClassHour} >${data.name}</option>
                                </#list>-->
							</select>
							<!--<input data-bv-message="The field is not valid" size="32" name="packageId" alt="课时包Id"-->
							<!--id="packageId" placeholder="课时包Id" type="text" title="课时包Id" class="form-control"
                            <!--value="${editEntity.packageId}"/>-->
							<!--<span class="text"></span>-->
						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label class="col-sm-3 col-sm-offset-1 control-label no-padding-right">
							<span style="color: red">*</span>课时数：</label>
						<label class="col-sm-6">
							<label>
								<input class="form-control" type="text" style="width:60px;height: 30px!important;" name="classHour" id="classHour" value="${editEntity.classHour}">
							</label>
							<label>
								课时 +
							</label>
							<label>
								<input class="form-control" type="text" style="width: 40px;height: 30px!important;" name="presentClassHour" id="presentClassHour" value="${editEntity.presentClassHour}">
							</label>
							<label>
								赠送课时
							</label>
							<!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
							<!--data-bv-integer="true" size="11" name="classHour" alt="课时数" id="classHour"-->
							<!--placeholder="课时数" type="text" title="课时数" class="form-control"-->
							<!--value="${editEntity.classHour}"/>-->
							<!--<span class="text"></span>-->
						</label>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="depositAmount" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">已交定金：</label>
						<div class="col-sm-6">
							<label>
								<input style="width:60px;height: 30px!important;" data-bv-integer-message="The field is number" data-bv-message="The field is not valid"
									   data-bv-integer="true" size="11" name="dearSonDepositAmount" alt="已交定金"
									   id="dearSonDepositAmount"  type="text" title="已交定金" class="form-control"
									   value="${depositAmount}"/>
							</label>
							<label>
								元
							</label>
						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="nowUnitPrice" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包原单价：</label>
						<label class="col-sm-6">
							<label>
								<input class="form-control" type="text" style="width:60px;height: 30px!important;" name="originalUnitPrice" id="originalUnitPrice" value="${editEntity.originalUnitPrice}">
							</label>
							<label>
								元
							</label>
							<!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
							<!--data-bv-numeric-message="The field is numeric" size="22" name="originalUnitPrice"-->
							<!--alt="课时包原单价" id="originalUnitPrice" placeholder="课时包原单价" type="text" title="课时包原单价"-->
							<!--class="form-control" value="${editEntity.originalUnitPrice}"/>-->
							<!--<span class="text"></span>-->
						</label>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="nowUnitPrice" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包现单价：</label>
						<label class="col-sm-6">
							<label>
								<input class="form-control" type="text" style="width:60px;height: 30px!important;" name="nowUnitPrice" id="nowUnitPrice" value="${editEntity.nowUnitPrice}"onblur="calculation(this)">
							</label>
							<label>
								元
							</label>
							<!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
							<!--data-bv-numeric-message="The field is numeric" size="22" name="nowUnitPrice" alt="课时包现单价"-->
							<!--id="nowUnitPrice" placeholder="课时包现单价" type="text" title="课时包现单价" class="form-control"-->
							<!--value="${editEntity.nowUnitPrice}"/>-->
							<!--<span class="text"></span>-->
						</label>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="sumPrice" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包总价：</label>
						<label class="col-sm-6">
							<label>
								<input class="form-control" type="text" style="width:60px;height: 30px!important;" name="dearSonSumPrice" id="sumPrice" value="${editEntity.sumPrice}">
							</label>
							<label>
								元
							</label>
							<!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
							<!--data-bv-numeric-message="The field is numeric" size="22" name="sumPrice" alt="课时包总价"-->
							<!--id="sumPrice" placeholder="课时包总价" type="text" title="课时包总价" class="form-control"-->
							<!--value="${editEntity.sumPrice}"/>-->
							<!--<span class="text"></span>-->
						</label>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="dearSonValidDate" class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span style="color: red">*</span>有效期：</label>
						<label class="col-sm-6">
							<label>
								<input class="form-control" type="text" style="width:60px;height: 30px!important;" name="dearSonValidDate" id="dearSonValidDate" value="${editEntity.validDate}">
							</label>
							<label>
								个月
							</label>
							<label>
								<button type="btn" class="btn btn-blue" style="border-color: #5db2ff!important;height:30px ;">激活</button>
							</label>
							<small class="help-block" style="">（注：激活后将从今日起开始计算有效期）</small>
							<!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
							<!--data-bv-integer="true" size="11" name="validDate" alt="有效期" id="validDate"-->
							<!--placeholder="有效期" type="text" title="有效期" class="form-control"-->
							<!--value="${editEntity.validDate}"/>-->
							<!--<span class="text"></span>-->
						</label>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="adminUserId" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">所属顾问：</label>
						<div class="col-sm-6">
							<!--<select name="adminUserId" id="adminUserId" class="col-sm-5" value="${editEntity.adminUserId}" style="height: 32px;">
                                <option value="">王依依</option>
                            </select>-->
							<select name="dearSonStaffId" id="dearSonStaffId" class="col-sm-5" value="" style="height: 32px;">
								<!-- <option id="staffselectDearSon" value="">请选择</option>
                                 <#list SysAdminUserList as data>
                                     <option  value="${data.id}">${data.name}</option>
                                 </#list>-->
							</select>

						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="remark" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">备注：</label>
						<div class="col-sm-6">
							<textarea class="form-control" name="dearSonRemark" size="500" rows="2" style="resize:none" id="remark" value="${editEntity.remark}"></textarea>
							<!--<input data-bv-message="The field is not valid" size="500" name="remark" alt="备注" id="remark"-->
							<!--placeholder="备注" type="text" title="备注" class="form-control"-->
							<!--value="${editEntity.remark}"/>-->
							<!--<span class="text"></span>-->
						</div>
					</div>
				</div>
			</#if>
			<div class="col-sm-12 margin-bottom-20 ">
				<div class="text-align-center">
					<button style="width: 80px;margin-right: 20px"  class="btn btn-blue" type="submit" id="editFormSubmitBtn_${serializeNum}">确定</button>
					<input style="width: 80px" type="button" class="btn btn-blue" data-dismiss="modal" value="取消"/>

				</div>
			</div>
		</div>
		<div class="interim hidden">
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="number" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">合同编号：</label>
						<div class="col-sm-6">
							<input data-bv-message="The field is not valid" size="50" name="contractNumber" alt="合同编号" id="number"
								   placeholder="1020039394" type="text" title="合同编号" class="form-control"
								   value="${editEntity.number}"/>
							<span class="text"></span>
						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="packageId" class="col-sm-3 col-sm-offset-1  control-label no-padding-right">课时包名称：</label>
						<div class="col-sm-6">
							<!--<select class="col-sm-12">
                                <option value="">2017预科月卡</option>
                            </select>-->
							<select name="packageId" id="packageId" class="col-sm-12" onchange="packageCheck(this)">
								<!--<option id="selectPackage" value="">请选择</option>
                                <#list excessPackageList as excessData>
                                    <option  value="${excessData.id}" packageId=${excessData.id} packageAttendanceDay=${excessData.attendanceDay}
                                             packageValidDate=${excessData.validDate} packageSumPrice=${excessData.sumPrice} >${excessData.name}</option>
                                </#list>-->
							</select>
							<!--<input data-bv-message="The field is not valid" size="32" name="packageId" alt="课时包Id"-->
							<!--id="packageId" placeholder="课时包Id" type="text" title="课时包Id" class="form-control"
                            <!--value="${editEntity.packageId}"/>-->
							<!--<span class="text"></span>-->
						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="depositAmount" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">已交定金：</label>
						<div class="6">
							<input style="width:60px;height: 30px!important;" data-bv-integer-message="The field is number" data-bv-message="The field is not valid"
								   data-bv-integer="true" size="11" name="depositAmount" alt="已交定金"
								   id="depositAmount"  type="text" title="已交定金" class="form-control"
								   value="${depositAmount}"/>
							<span class="text"></span>
						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="attendanceDay" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">可出勤天数：</label>
						<div class="col-sm-6">
							<label>
								<input class="form-control" type="text" style="width:60px;height: 30px!important;" name="attendanceDay" id="attendanceDay" value="${editEntity.attendanceDay}">
							</label>
							<label>
								个月
							</label>
							<!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
							<!--data-bv-integer="true" size="11" name="attendanceDay" alt="可出勤天数" id="attendanceDay"-->
							<!--placeholder="可出勤天数" type="text" title="可出勤天数" class="form-control"-->
							<!--value="${editEntity.attendanceDay}"/>-->
							<!--<span class="text"></span>-->
						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="sumPrice" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包总价：</label>
						<label class="col-sm-6">
							<label>
								<input class="form-control" type="text" style="width:60px;height: 30px!important;" name="sumPrice" value="${editEntity.sumPrice}">
							</label>
							<label>
								元
							</label>
							<!--<input data-bv-numeric="true" data-bv-message="The field is not valid"-->
							<!--data-bv-numeric-message="The field is numeric" size="22" name="sumPrice" alt="课时包总价"-->
							<!--id="sumPrice" placeholder="课时包总价" type="text" title="课时包总价" class="form-control"-->
							<!--value="${editEntity.sumPrice}"/>-->
							<!--<span class="text"></span>-->
						</label>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label class="col-sm-3 col-sm-offset-1 control-label no-padding-right">课时包性质：</label>
						<div class="col-sm-6">
							<label>
								<input type="radio">
								<span class="text" style="margin-top:6px">全日</span>
							</label>
							<label>
								<input type="radio">
								<span class="text" style="margin-top:6px">半日</span>
							</label>
							<!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
							<!--data-bv-integer="true" size="11" name="nature" alt="课时包性质" id="nature"-->
							<!--placeholder="课时包性质" type="text" title="课时包性质" class="form-control"-->
							<!--value="${editEntity.nature}"/>-->
							<!--<span class="text"></span>-->
						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="validDate" class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span style="color: red">*</span>有效期：</label>
						<label class="col-sm-6">
							<label>
								<input class="form-control" type="text" style="width:60px;height: 30px!important;" name="validDate" id="validDate" value="${editEntity.validDate}">
							</label>
							<label>
								个月
							</label>
							<label>
								<button type="btn" class="btn btn-blue" style="border-color: #5db2ff!important;height:30px ;">激活</button>
							</label>
							<small class="help-block" style="">（注：激活后将从今日起开始计算有效期）</small>
							<!--<input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"-->
							<!--data-bv-integer="true" size="11" name="validDate" alt="有效期" id="validDate"-->
							<!--placeholder="有效期" type="text" title="有效期" class="form-control"-->
							<!--value="${editEntity.validDate}"/>-->
							<!--<span class="text"></span>-->
						</label>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="adminUserId" class="col-sm-3 col-sm-offset-1 control-label no-padding-right"><span style="color: red">*</span>所属顾问：</label>
						<div class="col-sm-6">
							<!--<select name="adminUserId" id="adminUserId" class="col-sm-5" value="${editEntity.adminUserId}" style="height: 32px;">
                                <option value="">王依依</option>
                            </select>-->
							<select name="adminUserId" id="adminUserId" class="col-sm-5" value="" style="height: 32px;">
								<option id="staffselect" value="">请选择</option>
								<#list SysAdminUserList as data>
									<option  value="${data.id}">${data.name}</option>
								</#list>
							</select>

							<!--<input data-bv-message="The field is not valid" size="32" name="adminUserId" alt="所属顾问" id="adminUserId"-->
							<!--placeholder="所属顾问" type="text" title="所属顾问" class="form-control"-->
							<!--value="${editEntity.adminUserId}"/>-->
							<!--<span class="text"></span>-->
						</div>
					</div>
				</div>
			</#if>
			<#if (true && editModel=='add')||(true && editModel=='edit')>
				<div class="col-xm-12 col-sm-6 col-lg-12 margin-bottom-20">
					<div class="form-group">
						<label for="remark" class="col-sm-3 col-sm-offset-1 control-label no-padding-right">备注：</label>
						<div class="col-sm-6">
							<textarea class="form-control" name="remark" size="500" rows="2" style="resize:none" value="${editEntity.remark}"></textarea>
							<!--<input data-bv-message="The field is not valid" size="500" name="remark" alt="备注" id="remark"-->
							<!--placeholder="备注" type="text" title="备注" class="form-control"-->
							<!--value="${editEntity.remark}"/>-->
							<!--<span class="text"></span>-->
						</div>
					</div>
				</div>
			</#if>
			<div class="col-sm-12 margin-bottom-20">
				<div class="text-align-center">
					<button style="width: 80px;margin-right: 20px" type="submit" class="btn btn-blue" id="editFormSubmitBtn_${serializeNum}">确定</button>
					<input style="width: 80px" type="button" class="btn btn-blue" data-dismiss="modal" value="取消"/>
				</div>
			</div>
		</div>
	</form>
</div>
<script src="assets/js/validation/bootstrapValidator_init.js"></script>
<script>
    function ajaxPackageList(type) {
        ajaxRequest("tssPackageController/ajaxPackageListByType.do", {
            type: type
        }, function (result) {
            var data=result.data;
            var arr=['<option value="0">请选择</option>'];
            if(type == 1){
                for (var i = 0; i< data.length; i++) {
                    //arr.push('<option value="'+t.id+'">'+t.name+'</option>')
                    arr.push('<option  value="'+data[i].id+'" packageId="'+data[i].id+'" packageOriginalUnitPrice="'+data[i].originalUnitPrice+'" packageValidDate="'+data[i].validDate+'" packageTotalClassHour="'+data[i].totalClassHour+'" >'+data[i].name+'</option>')
                }
                $('#dearSonPackageId').html(arr.join(''));
            }else{
                for (var i = 0; i< data.length; i++) {
                    //arr.push('<option value="'+t.id+'">'+t.name+'</option>')
                    arr.push('<option  value="'+data[i].id+'" packageId="'+data[i].id+'" packageAttendanceDay="'+data[i].attendanceDay+'" packageValidDate="'+data[i].validDate+'" packageSumPrice="'+data[i].sumPrice+'" >'+data[i].name+'</option>')
                }
                $('#packageId').html(arr.join(''));
            }
            //$('#dearSonPackageId').html(arr.join(''))

        }, function () {
            ajaxError("加载课程包失败")
        }, "get", "json")
    }
    function ajaxStaffList() {
        ajaxRequest("sysAdminUserController/getPostListByDuty.do",{
            duty:1
        }, function (result) {
            var data=result.data;
            var arr=['<option value="0">请选择</option>'];
            for (var i = 0; i< data.length; i++) {
                arr.push('<option value="'+data[i].id+'">'+data[i].realName+'</option>')
            }
            $('#dearSonStaffId').html(arr.join(''));
            $('#adminUserId').html(arr.join(''));
        },function(){
            ajaxError("加载员工信息失败");
        }, "post","json")
    };
    $(function(){
        var type = 1;
        ajaxPackageList(type);
        ajaxStaffList();
    });


    $(".selectpicker_${serializeNum}").select2();

    $("#editForm_${serializeNum}").bind("ajaxSubmitCallback", function (event, result) {
        alert(result.resMsg);
        if (result.resCode == 200) {
            bootbox.hideAll();
        }
    });

    $(".parentChildBtn").click(function () {
        $(".packageType").val(1);
        $(".parentChild").removeClass("hidden").addClass("show");
        $(".interim").removeClass("show").addClass("hidden");
        $('.parentChildBtn').css("background","#5db2ff");
        $('.interimBtn').css("background","#fff");
        $(".modal-title").html("亲子课时包");
        var type = $(".packageType").val();
        ajaxPackageList(type)
    })
    $(".interimBtn").click(function () {
        $(".packageType").val(2);
        $(".interim").removeClass("hidden").addClass("show");
        $(".parentChild").removeClass("show").addClass("hidden");
        $('.interimBtn').css("background","#5db2ff");
        $('.parentChildBtn').css("background","#fff");
        $(".modal-title").html("过渡课时包");

        var type = $(".packageType").val();
        ajaxPackageList(type)
    })
    /**
     * 选择课时包
     * @param that
     */
    function packageCheck(that) {
        var id = $(that).attr("id");
        if(id == 'dearSonPackageId'){
            var packageId =$("#dearSonPackageId").find("option:selected").attr("packageId");
            var packageOriginalUnitPrice =$("#dearSonPackageId").find("option:selected").attr("packageOriginalUnitPrice");
            var packageValidDate =$("#dearSonPackageId").find("option:selected").attr("packageValidDate");
            var packageTotalClassHour =$("#dearSonPackageId").find("option:selected").attr("packageTotalClassHour");

            console.log(packageId);
            console.log(packageOriginalUnitPrice);
            console.log(packageValidDate);
            console.log(packageTotalClassHour);

            $('input[name="classHour"]').eq(0).val(packageTotalClassHour);
            $('input[name="originalUnitPrice"]').eq(0).val(packageOriginalUnitPrice);
            $('input[name="dearSonValidDate"]').eq(0).val(packageValidDate);
        }else{
            var packageId =$("#packageId").find("option:selected").attr("packageId");
            var packageAttendanceDay =$("#packageId").find("option:selected").attr("packageAttendanceDay");
            var packageSumPrice =$("#packageId").find("option:selected").attr("packageSumPrice");
            var packageValidDate =$("#packageId").find("option:selected").attr("packageValidDate");


            $('input[name="attendanceDay"]').eq(0).val(packageAttendanceDay);
            $('input[name="sumPrice"]').eq(0).val(packageSumPrice);
            $('input[name="validDate"]').eq(0).val(packageValidDate);


        }
    }
    function calculation(that){
        var nowUnitPrice = $(that).val();
        console.log("nowUnitPrice:"+nowUnitPrice);
        var packageTotalClassHour = $('input[name="classHour"]').val();
        console.log("packageTotalClassHour:"+packageTotalClassHour);
        var sum = nowUnitPrice * packageTotalClassHour;
        console.log("sum:"+sum);
        $('input[name="dearSonSumPrice"]').val(sum);
    }
</script>